<template>
	<div id="userCenter"> 
		<scroller ref="scroller"  >
		<div class="main_user pd333">
		 	<div class="userHader">
		 		<img class="backgimg" src="../../../assets/clientele/homepage/timg.jpg"/>
		 		<div class="usertext">
		 			<i><img :src="doorImg" alt="加载失败" :onerror="imgError" /></i>
		 			<p>
		 				<span>{{ShopName}}</span>
		 				<!--<a>个人信息></a>-->
		 			</p>
		 		</div> 
		 	</div>  
		 	<div class="listUser mu15 md30">
		 		<ul>
		 			<router-link tag="li" :to="item.href" v-for="item in listItmes" :key="item.id">
		 				<a> 
			 				<i class="iconfont" :class="item.className"></i>
			 				<span>{{item.name}}</span>
			 				<i class="iconfont icon-fanhui"></i>
		 				</a>
		 			</router-link> 
		 		</ul>
		 	</div> 
		 </div>
		</scroller>  
	</div>
</template>

<script>
	import { Toast } from 'mint-ui';
	export default{
		name:'home', 
		components:{  
		},
		data(){
			return{ 
				listItmes:[
					{
						name:'我的钱包',
						className:'icon-qianbao',
						href:'/merchant/userWallet'
					},
					{
						name:'订单列表',
						className:'icon-dingdanliebiao',
						href:'/merchant/userOrder'
					},
					{
						name:'我的店铺二维码',
						className:'icon-dianpuerweima',
						href:'/merchant/storeCode'
					},
					/*{
						name:'店铺管理',
						className:'icon-dianpuguanli',
						href:'/merchant/decoration'
					},*/
					{
						name:'商品管理',
						className:'icon-guanli',
						href:'/merchant/manageGoods'
					},
					/*{
						name:'退出登录',
						className:'icon-tuichu',
						href:''
					}*/
					 
				],
				ShopName:'',//店铺名称
				doorImg:'',//头像
				
				
			}
		},
		created() {
			this.imgError = this.$store.state.imgError; 
		}, 
		mounted() {
			this.getOrderDetail();
		},
		methods: {
			getOrderDetail(){
				this.$http.get('/ManagerGroupBuy/GetUser').then((res)=>{
					 
					if(res.data.code==1){
						let Data=res.data.data.ShopData
						this.ShopName=Data.ShopName;
						this.doorImg=Data.doorImg 
						this.WXstare(Data);
					}else{
						Toast(res.data.msg); 
					}
				}).catch((err)=>{
					
				}); 
			},
			//分享商品
			WXstare(items){ 
				console.log(items)
				let param={
		            title: items.Remarks, // 分享标题
		            desc:items.ShopName,// 分享描述
		            link:'/merchant/userCenter?shopID='+this.shopId, // 分享链接
		            imgUrl:items.doorImg, // 分享图标
		            success: function (res) {
		              // 用户确认分享后执行的回调函数
		              window.alert("已经分享成功！")
		            },
		            cancel: function (res) {
		              // 用户取消分享后执行的回调函数
		               window.alert("分享失败！")
		            }
				} 
				this.wxShare(1,param); 
			}
			
			
			
		}
		
		
		
		
	}
	
	
	
</script> 
<style scoped>
	.main_user{
		width: 100%;  
	}
	.userHader{
		width: 100%;
		height:5rem;
		position: relative;
	}
	.userHader .backgimg{
		width: 100%;
		height: 100%;
	}
	.userHader .usertext{
		position: absolute;
		z-index: 20;
		left: 0;
		bottom:30%;
		padding: 0 1rem;
	}
	.usertext i{
		float: left;
		width: 2rem;
		height: 2rem;
		border-radius:100%;
		overflow: hidden;
	}
	.usertext i img{
		width: 100%;
		height: 100%;
	}
	.usertext p{
		float: left;
		font-size: 0.373333rem;
		color: #6530e0;
		padding-left: 0.5rem;
		font-weight: 700;
	}
	.usertext p span{
		display: block;
		margin-top: 0.3rem;
	}
	.usertext p a{
		float: left;
		margin-top: 0.3rem;
		color: #666666;
	}
	
	.myorders{
		width: 100%;
		background-color: #FFFFFF;
	}
	.hengx{
		padding:0.2rem 0.3rem;
		color:#666666;
		overflow:hidden;
		font-size: 0.373333rem;
		border-bottom:1px solid #CCCCCC;
	}
	.hengx a{
		color: #999999;
	}
	 .gords {
	 	display: flex;
	 	justify-content: space-around;
	 }
	 .gords li{
	 	display: flex;
	 	flex-direction: column;
	 	justify-content: center;
	 	height:2rem;
	 	align-items:center;
	 	color: #666666;
	 	font-size:0.346666rem;
	 	align-content:center;
	 }
	 .gords li i{
	 	font-size: 0.666666rem;
	 }
	 
	 .listUser{
	 	width: 100%;
	 }
	 .listUser ul li{
	 	background-color: #FFFFFF;
	 	padding: 0.3rem 0.3rem;
	 	border-bottom: 1px solid #CCCCCC;
	 	line-height: 0.5rem;
	 }
	 .listUser ul li a{
	 	display: block;
	 }
	 .listUser ul li a i.icon-fanhui{
	 	float: right;
	 }
	 .listUser ul li a i:nth-child(1){
	 	width: 0.666666rem;
	 	font-size:0.6rem;
	 	float: left;
	 	color: #666;
	 }
	 .listUser ul li a span{
	 	font-size: 0.346666rem;
	 	margin-left: 0.3rem;
	 }
</style>